package com.project.bean;

import java.util.ArrayList;
import java.util.List;

/**
 * 分页实体类
 */
public class CutPageBean<T>{
    //当前页需要显示的数据
    private List<T> list=new ArrayList<>();
    //总记录数
    private int count;
    //总页数
    private int toalPage;
    //每页显示记录数
    public static final int PAGESIZE=3;

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
        this.toalPage=count%PAGESIZE ==0? count/PAGESIZE : count/PAGESIZE+1;
    }

    public int getToalPage() {
        return toalPage;
    }

    @Override
    public String toString() {
        return "CutPageBean{" +
                "list=" + list +
                ", count=" + count +
                ", toalPage=" + toalPage +
                '}';
    }
}
